window.addEvent('load',function()
{
    //斑马表
    var list=new ZebraTable(document.getElementById('List'));
    {
        list.Color_1='#ffffff';
        list.Color_2='#f6f6f6';
        list.Color_3='#ebeff9';
        list.Render('tbody');
    }
    list=null;

    
    //添加
     $$('#LinkAdd').addEvent('click',function()
    {

      if($('Name_Add').value=='')
        {
		malert('名称不能为空');	  
        }
	  else if($('Role_Add').value=='')
        {
		malert('权限值不能为空');	  
        }
      else if($('URL_Add').value=="")
	    {  
            malert('链接地址不能为空');
	    }
	  else
	    {
	  	  $('Form1').action='member.permission.add.action.php';
          $('Form1').submit();  
	    }
    });
    
	$$('#BranchAdd').addEvent('click',function()
    {
	  	if($('Branch_Class').value=='')
        {
			malert('模块不能为空');	  
        }
	  	else if($('Branch_Name').value=='')
        {
			malert('名称不能为空');	  
        }
      	else if($('Branch_Role').value=="")
	    {  
            malert('权限值不能为空');
	    }
	  	else
	    {
	  	  $('Form1').action='branch.permission.add.action.php';
          $('Form1').submit();  
	    }
	});
});

 
function Edit(ID)
{
	var Names=$('Name_'+ID).value;
	var Roles=$('Role_'+ID).value;
	var URLs=$('URL_'+ID).value;
	var RealSorts=$('RealSort_'+ID).value;
	window.location='member.permission.edit.action.php?id='+ID+'&name='+Names+'&role='+Roles+'&url='+URLs+'&RealSort='+RealSorts;
}